import Vue from 'vue'
import moment from 'moment'

Vue.mixin({

  methods: {
    hasAuth (perm) {
      var authority = this.$store.state.menus.permList
      return authority.indexOf(perm) > -1
    }
  },
  dateFormat (row, col) {
    var date = row[col.property]
    if (date === undefined) {
      return ''
    }
    return moment(date).format('YYYY-MM-DD HH:mm:ss')
  }
})
